import http from "../request";
const apibase = "/api/JobTemplet";

//获取工作模板
var getJobTemplets = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/GetJobTemplets`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//新增工作模板
var addJobTemplets = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/AddJobTemplets`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//修改工作模板
var updateJobTemplets = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/UpdateJobTemplets`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//删除工作模板
var deleteJobTemplets = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/DeleteJobTemplets`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

export { getJobTemplets, addJobTemplets, updateJobTemplets, deleteJobTemplets };
